package com.ruoyi.fitsculpt.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fitsculpt.mapper.EasyfitExercisePlanDetailsMapper;
import com.ruoyi.fitsculpt.domain.EasyfitExercisePlanDetails;
import com.ruoyi.fitsculpt.service.IEasyfitExercisePlanDetailsService;

/**
 * 运动计划详情Service业务层处理
 *
 * @author metaee
 * @date 2025-02-27
 */
@Service
public class EasyfitExercisePlanDetailsServiceImpl implements IEasyfitExercisePlanDetailsService {
    @Autowired
    private EasyfitExercisePlanDetailsMapper easyfitExercisePlanDetailsMapper;

    /**
     * 查询运动计划详情
     *
     * @param detailId 运动计划详情主键
     * @return 运动计划详情
     */
    @Override
    public EasyfitExercisePlanDetails selectEasyfitExercisePlanDetailsByDetailId(Long detailId) {
        return easyfitExercisePlanDetailsMapper.selectEasyfitExercisePlanDetailsByDetailId(detailId);
    }

    /**
     * 查询运动计划详情列表
     *
     * @param easyfitExercisePlanDetails 运动计划详情
     * @return 运动计划详情
     */
    @Override
    public List<EasyfitExercisePlanDetails> selectEasyfitExercisePlanDetailsList(EasyfitExercisePlanDetails easyfitExercisePlanDetails) {
        return easyfitExercisePlanDetailsMapper.selectEasyfitExercisePlanDetailsList(easyfitExercisePlanDetails);
    }

    /**
     * 新增运动计划详情
     *
     * @param easyfitExercisePlanDetails 运动计划详情
     * @return 结果
     */
    @Override
    public int insertEasyfitExercisePlanDetails(EasyfitExercisePlanDetails easyfitExercisePlanDetails) {
        easyfitExercisePlanDetails.setCreateTime(DateUtils.getNowDate());
        return easyfitExercisePlanDetailsMapper.insertEasyfitExercisePlanDetails(easyfitExercisePlanDetails);
    }

    /**
     * 修改运动计划详情
     *
     * @param easyfitExercisePlanDetails 运动计划详情
     * @return 结果
     */
    @Override
    public int updateEasyfitExercisePlanDetails(EasyfitExercisePlanDetails easyfitExercisePlanDetails) {
        return easyfitExercisePlanDetailsMapper.updateEasyfitExercisePlanDetails(easyfitExercisePlanDetails);
    }

    /**
     * 批量删除运动计划详情
     *
     * @param detailIds 需要删除的运动计划详情主键
     * @return 结果
     */
    @Override
    public int deleteEasyfitExercisePlanDetailsByDetailIds(Long[] detailIds) {
        return easyfitExercisePlanDetailsMapper.deleteEasyfitExercisePlanDetailsByDetailIds(detailIds);
    }

    /**
     * 删除运动计划详情信息
     *
     * @param detailId 运动计划详情主键
     * @return 结果
     */
    @Override
    public int deleteEasyfitExercisePlanDetailsByDetailId(Long detailId) {
        return easyfitExercisePlanDetailsMapper.deleteEasyfitExercisePlanDetailsByDetailId(detailId);
    }
}
